﻿<Window x:Class="StockholmsStad.Windows.UI.LogonScreen"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Parvis inloggning"
    Icon="/StockholmsStad.Windows.UI;component/Resources/Icons/vigpar.ico"        
    SizeToContent="WidthAndHeight"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    ResizeMode="NoResize"
    MinWidth="360"
    BorderThickness="1"
    AllowsTransparency="True">
    <Window.Resources>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="MinWidth" Value="100"/>
        </Style>
        <Style TargetType="PasswordBox">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="MinWidth" Value="100"/>
        </Style>
        <Style TargetType="Button">
          <Setter Property="FontFamily" Value="MS Reference Sans Serif" />
            <Setter Property="FontSize" Value="11" />
            <Setter Property="Width" Value="90" />
            <Setter Property="Height" Value="30" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="Foreground" Value="Black" />
        </Style>
    </Window.Resources>

    <Window.BorderBrush>
        <RadialGradientBrush>
            <GradientStop Color="#FF404070" Offset="0"/>
            <GradientStop Color="#55000000" Offset="1"/>
        </RadialGradientBrush>
    </Window.BorderBrush>    

    <Grid>       
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        
        <Grid Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Image Source="/StockholmsStad.Windows.UI;component/Resources/Icons/vigpar.ico" Margin="15" Grid.Column="0" />
            <StackPanel Orientation="Vertical" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
                <TextBlock Text="Parvis Inloggning" FontSize="22"
                HorizontalAlignment="Center" VerticalAlignment="Center" Margin="45, 0, 30, 0" />
                <TextBlock x:Name="TextBoxVersion" FontSize="11" 
                HorizontalAlignment="Center" VerticalAlignment="Center" Margin="45, 0, 30, 0" />
            </StackPanel>
        </Grid>
        
        <Grid Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="4" Margin="5, 10, 5, 10">
            <Grid.Background>
                <ImageBrush ImageSource="/Resources/Images/frame.png" />
            </Grid.Background>
        </Grid>
                
        <Label Grid.Column="0" Grid.Row="1"
               HorizontalAlignment="Right"
               Content="Användarnamn" Margin="15, 25, 0, 0" />
        <TextBox Grid.Column="1" Grid.Row="1" Text=""
                 GotFocus="DoCredentialsFocussed"
                 x:Name="xUsername" Margin="10, 25, 20, 0" />
        <Label Grid.Column="0" Grid.Row="2"
               HorizontalAlignment="Right"
               Content="Lösenord" Margin="10, 10, 0, 0"  />
        <PasswordBox Grid.Column="1" Grid.Row="2" Password=""
                     GotFocus="DoCredentialsFocussed"
                     x:Name="xPassword" Margin="10, 10, 20, 0" />

        <Label Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"
               HorizontalAlignment="Center"
               Foreground="Gray"
               FontStyle="Italic"
               Visibility="{Binding HintVisibility}"
               Content="Ange x/x för att logga in"/>

        <StackPanel Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"
                    Orientation="Horizontal"
                    VerticalAlignment="Bottom"
                    Margin="5"
                    HorizontalAlignment="Right" Height="Auto">
            <Button x:Name="LogonButton" Content="Logga in" Click="LogonButton_Click" IsDefault="True" Margin="10, 15, 0, 5" />
            <Button x:Name="CancelButton" Content="Avbryt" Click="CancelButton_Click" IsCancel="True" Margin="10, 20, 15, 10" />
        </StackPanel>

    </Grid>
</Window>
